This invention generally relates to computer systems, and more particularly to a system and method for controlling computer processes in a multiprogramming/multiprocessing environment.
In a multiprogramming/multiprocessing environment, multiple users are simultaneously employing a single computer system; and in such a system, multiple processes compete for resources within the computer system. Each process consists of a program--that is, an ordered collection of instructions and other data associated with the instructions--which is executed by the computer and operates on data to perform a user's job or some phase of that job. Where many such processes are demanding simultaneous attention from the system, the task of communicating with and between such processes and the task of controlling and allocating resources to such processes become extremely complex; and usually, a main, control program is employed to control operation of the computer system as a whole, and in particular, to establish priority among the users and to invoke various process modules to perform work for those users.
When a user obtains access to, or logs on, a multiprogramming/multiprocessing computer system, the control program assigns that user a group of addressable memory blocks which together form a unit referred to as a control block, in which are stored local variables, references to program procedures, data arrays and current process status. The control program performs a process on behalf of a particular user in accordance with instructions from that user, and with instructions that may be stored in the control program. While conducting a particular process, the control program may access the control block, which was established on behalf of that user, several times, for instance, to temporarily store data, to receive data, and to receive specific instructions. When a user releases access to, or logs off, the computer system, the memory blocks that were assigned to the control block representing that user are released and become available for a subsequent assignment to a new user.
When multiple users are simultaneously employing a single computer system, each user is represented to the control program by a respective control block, and the control program invokes the process modules to control operation of the computer system and to perform services for the control blocks. Typically, at any one point in time, only one process module is operating, and that module is servicing only one control block; and when that process module completes its operation, another process module is called upon to service that one, or another, control block. Occasionally, operation of a first process module that is servicing a first control block will be temporarily interrupted or suspended, for example, while data is being transferred into that first control block. To improve the performance of the computer system as a whole, during such a temporary interruption of a process module, the control program may call upon a second process module to service a second control block. When the operation of the second process module is completed, the control of the computer system is returned to the first process module and operation of this process module may resume.
It is very possible that the user represented by the first control block might have logged off the computer system while the second process module was controlling operation of that system; and, in this case, the memory blocks forming the first control block are reassigned to the main memory of the computer system. The first process module may not know that the first control block has been released; and the first process module may resume operation and alter data in, add data to, or delete data from the memory blocks that formed the first control block This may result in an undesirable overlaying of data in those memory blocks
There are two procedures to prevent this overlaying of data. One procedure is to program each process module to re-scan all of the control blocks each time an interrupted process module resumes control of the computer system. If the particular control block with which the process module was working, remains formed, the process module resumes operation. However, if the scan shows that the particular control block, with which the process module was working, has been released, the process module does not resume operation, and, for example, control of the computer system may be returned to the control program. This procedure is relatively time consuming, however, especially if there are many control blocks on the computer system.
Another technique to prevent the above-discussed data overlay is to employ a locking procedure. For example, when a process module is temporarily interrupted, the particular control block with which that module was working, is locked so that other processes, and in particular a log off process, cannot access that particular control block. In this way, the interrupted process module can be sure that the log off process will not release that particular control block. A major disadvantage to this technique is that it also reduces wanted or desired access to the control block while operation of the interrupted process module is suspended, reducing system performance. Further, this procedure usually requires that a list of locks be formed, and that all the process modules of the computer systems scan that whole list before accessing a particular control block.